package main

import "fmt"

func main() {
	fmt.Println(defer04())
	defer defer01()
	defer defer02()
	defer defer03()
}
func defer01() {
	defer fmt.Println("defer01")
	defer fmt.Println("01")
}
func defer02() {
	defer fmt.Println("defer02")
	defer fmt.Println("02")
}
func defer03() {
	defer fmt.Println("defer03")
	defer fmt.Println("03")
}
func defer04() (i int) {
	i = 1
	defer func() {
		fmt.Println(i)
	}()
	return i + 1
}
